package com.sync.platform.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sync.platform.entity.RestoreTask;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * Database restore task service interface
 */
public interface RestoreTaskService extends IService<RestoreTask> {

    /**
     * Save restore task
     *
     * @param id Task ID (null for new task)
     * @param name Task name
     * @param databaseId Target database ID
     * @param description Task description
     * @param backupFile Backup file (SQL dump or similar)
     * @return true if saved successfully, false otherwise
     */
    boolean saveRestoreTask(Long id, String name, Long databaseId, String description, MultipartFile backupFile);

    /**
     * Execute restore task
     *
     * @param id Task ID
     * @return Execution result
     */
    Map<String, Object> executeTask(Long id);

    /**
     * Upload backup file
     *
     * @param file Backup file
     * @param databaseId Target database ID
     * @return File identifier
     */
    String uploadBackupFile(MultipartFile file, Long databaseId);

    /**
     * Get backup history for a database
     *
     * @param databaseId Database ID
     * @return List of backup history entries
     */
    List<Map<String, Object>> getBackupHistory(Long databaseId);
} 